<!DOCTYPE html>
<html lang="en" style="height:100%;">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>提现明细</title>

    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/yzl.css"/>

</head>
<body style="height:100%;background-color:white;" >
<div id="blank" class="header" v-cloak>
    <div v-back.tapmode class="back"></div>
    <span class="title">提现明细</span>
</div>
<div id="app" class="top-container" style="background-color:#fff" v-cloak>
    <div class="message-none" v-if="details.length == 0">
        <img v-src="'../../image/not_available.png'">
        <div>暂无提现明细</div>
    </div>
    <div class="withdraw_list-row" v-for="detail in details" v-row-active.tapmode v-open-win="detail" vurl="withdraw_detail">
        <div>
            <span>{{detail.price}}</span>
            <span>{{detail.date_add | date}}</span>
        </div>
        <div>
            <span>{{getType(detail.type)}}提现</span>
            <span style="color:#eb6823">{{getState(detail.state)}}</span>
        </div>
    </div>
    <lazy-load
            style="margin:10px 0"
            v-if="details.length > 0"
            count-per-page="20"
            :arr="details"
            :url="url"
    >
    </lazy-load>
</div>
</body>
<script src="../../script/api.js"></script>
<script src="../../script/vue.js"></script>
<script src="../../script/app.js"></script>
<script src="../../script/common.js"></script>
<script src="../../script/url.js"></script>
<script src="../../script/components.js"></script>

<script>
    var details;
    apiready = function () {
        showProgress();
        setBSImg();
        new Vue({
            el:'#blank'
        });

        var data = {
            member_id: getPrefs('member_id')
        };
        var callback = function (ret) {
            details = ret.content;
            initApp();
            api.parseTapmode();
        };
        pinet.post(URL.getWithdrawDetail, data, callback);

        addListeners();
    };

    function initApp() {
        new Vue({
            el:'#app',
            data:{
                details:details,
                url:URL.getWithdrawDetail
            },
            methods:{
                getType: function (type) {
                    switch (type) {
                        case '1':
                            return '支付宝';
                        case '2':
                            return '银行卡';
                    }
                },
                getState: function (state) {
                    switch (state) {
                        case '1':
                            return '申请中';
                        case '2':
                            return '已通过';
                        case '3':
                            return '未通过';

                    }
                }
            }
        })
    }

    function addListeners() {
        api.addEventListener({
            name: 'viewappear'
        }, function () {
            onPageStart();
        });

        api.addEventListener({
            name: 'viewdisappear'
        }, function (ret, err) {
            onPageEnd();
        });

        api.addEventListener({
            name: 'keyback'
        }, function (ret, err) {
            onPageEnd();
            api.closeWin();
        });
    }

</script>
</html>